package com.situ.day12;

public class MoneyManager {

	//余额
	private Double balance;
	//用户的账户
	private String number;
	public MoneyManager(Double balance, String number) {
		super();
		this.balance = balance;
		this.number = number;
	}
	
	//存钱
	public void deposite(double money) {
		balance += money;
	}
	
	//取钱
	public void withdraw(double money) throws MyException {
		if (balance >= money) {
			balance -=money;
		}else {
			//余额不足
			double need = money - balance;
			throw new MyException(need);
		}
	}
	
}
